Is this a correct use of using protocols and delegate pattern in Swift